沟通管理API
获取联系人列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object<result> | Body | 返回结果 |
result说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| family_name | String | Body | 家庭名称 |
| sip_group | String | Body | SIP群组号 |
| devices | []Object<device> | Body | 设备信息 |
| accounts | []Object<account> | Body | 账号信息 |
| akuvox_devices | []Object<akuvox_device> | Body | Akuvox设备信息 |
| ciphertext | String | Body | 密文,依赖SDK解析 |
device说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| device_id | String | Body | 设备ID |
| device_name | String | Body | 设备名称 |
| mac | String | Body | MAC地址 |
| sip | String | Body | SIP号 |
account说明
| 参数名 | 类型 | 位置 | 说明 | 说明 |
|---|---|---|---|---|
| account_id | String | Body | 账号ID | 账号ID |
| account_name | String | Body | 账号名称 | |
| first_name | String | Body | 名 | |
| last_name | String | Body | 姓 | |
| String | Body | 邮箱 | ||
| sip | String | Body | SIP号 | |
| main_sip | String | Body | 主SIP号 |
akuvox_device说明
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| device_name | String | Body | 设备名称 |
| mac | String | Body | MAC地址 |
| sip | String | Body | SIP号 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_contact_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
状态码:200
{
"success": true,
"timestamp": 1540869200562,
"result": {
"family_name": "my home",
"sip_group": "1251318313",
"ciphertext": "7b3d75f5a8cfa959167852468fca08a3",
"devices": [
{
"device_id": "d1d54e460365949109ec306dc6e37679b",
"device_name": "51",
"mac": "0C110532D242",
"sip": "123132312"
}
],
"accounts": [
{
"account_id": "a1d54e460365949109ec306dc6e37679b",
"account_name": "demo@akubela.com",
"first_name": "tom",
"last_name": "fly",
"email": "demo@akubela.com",
"sip": "423143312",
"main_sip": "423143312"
}
],
"akuvox_devices": [
{
"device_name": "door",
"mac": "0C110532D246",
"sip": "223132812"
}
]
}
}
失败返回示例
见 接口失败返回
上报沟通消息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
请求参数
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 内容类型,值为application/json |
| Accept | String | Header | 是 | 接受类型,值为application/json |
| Authorization | String | Header | 是 | Bearer认证,访问令牌 |
| command | String | Body | 是 | 命令名称 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令参数 |
param说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| communication_messages | []Object<communication_message> | Body | 是 | 沟通信息 |
communication_message说明
| 参数名 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
| communicate_id | String | Body | 是 | 沟通ID |
| timestamp | Integer | Body | 是 | 时间戳 |
| from | String | Body | 是 | 发送方ID 账号ID:发送方为用户 设备ID:发送方为设备 |
| to | String | Body | 是 | 接收方ID 住宅ID:对家庭下的用户与设备群发 账号ID:接收方为用户 |
| format | String | Body | 是 | 消息格式 text:文本 voice:语音 |
| content | String | Body | 是 | 消息内容 text:文本内容 voice:语音文件文件名 |
| duration | Integer | Body | 否 | 语音时长,单位:秒 |
返回参数
| 参数名 | 类型 | 位置 | 说明 |
|---|---|---|---|
| Content-Type | String | Header | 内容类型,值为application/json |
| success | Boolean | Body | 判断请求是否成功 true:成功 false:失败 |
| timestamp | Integer | Body | 时间戳 |
| result | Object | Body | 返回结果 |
请求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "report_communication_message",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"communication_messages": [
{
"communicate_id": "c6e3861d5d4ca4dcd8e76d84f1ecd49b9",
"timestamp": 193239428274,
"from": "a1d54e460365949109ec306dc6e37679b",
"to": "a42bdd7f6cb5ad478f3471539c2547b42",
"format": "voice",
"content": "f92c1118be3524f84bf59051cc1255f3d",
"duration": 15
}
]
}
}
成功返回示例
状态码:200
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失败返回示例
见 接口失败返回